<?php
/*
Template Name:DC_ting
Description:Mv模板。支持全高清网盘资源下载。代码重新架构.添加虾米音乐双解析,添加艺人档案
Version:T_3.0.0
Author:D&C
Author Url:http://www.iuunet.com & http://ting.iuunet.com
Sidebar Amount:1
*/
if(!defined('EMLOG_ROOT')) {exit('error!');} 
require_once View::getView('module');
require_once View::getView('inc/youku.class');
require_once View::getView('function');
require_once View::getView('inc/tingcache');
$cache = new ting_cache('ting',3600,0,'.html');
?>
<!DOCTYPE html>
<html lang="en" class="app">
<head>  
  <meta charset="utf-8" />
  <title><?php echo $site_title; ?></title>
  <meta name="keywords" content="<?php echo $site_key; ?>" />
  <meta name="description" content="<?php echo $site_description; ?>" />
  <meta name="generator" content="emlog" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <?php doAction('index_head'); ?>
  <link rel="Bookmark shortcut icon" href="<?php echo TEMPLATE_URL; ?>images/favicon.ico"/>
  <link rel="stylesheet" href="<?php echo TEMPLATE_URL; ?>js/jPlayer/jplayer.flat.css" type="text/css" />
  <link rel="stylesheet" href="<?php echo TEMPLATE_URL; ?>css/bootstrap.css" type="text/css" />
  <link rel="stylesheet" href="<?php echo TEMPLATE_URL; ?>css/animate.css" type="text/css" />
  <link rel="stylesheet" href="<?php echo TEMPLATE_URL; ?>css/font-awesome.min.css" type="text/css" />
  <link rel="stylesheet" href="<?php echo TEMPLATE_URL; ?>css/simple-line-icons.css" type="text/css" />
  <link rel="stylesheet" href="<?php echo TEMPLATE_URL; ?>css/font.css" type="text/css" />
  <link rel="stylesheet" href="<?php echo TEMPLATE_URL; ?>css/app.css" type="text/css" /> 
  <script type="text/javascript" src="<?php echo BLOG_URL; ?>include/lib/js/common_tpl.js"></script>
  
  
    <!--[if lt IE 9]>
    <script src="<?php echo TEMPLATE_URL; ?>js/ie/html5shiv.js"></script>
    <script src="<?php echo TEMPLATE_URL; ?>js/ie/respond.min.js"></script>
    <script src="<?php echo TEMPLATE_URL; ?>js/ie/excanvas.js"></script>
  <![endif]-->
</head>
<body class="">
  <section class="vbox">
    <header class="bg-white-only header header-md navbar navbar-fixed-top-xs">
      <div class="navbar-header aside bg-info nav-xs">
        <a class="btn btn-link visible-xs" data-toggle="class:nav-off-screen,open" data-target="#nav,html">
          <i class="icon-list"></i>
        </a>
        <a href="<?php echo BLOG_URL; ?>" class="navbar-brand text-lt" data-target="#content" data-el="#bjax-el" data-replace="true">
          <i class="icon-earphones"></i>
          <img src="<?php echo TEMPLATE_URL; ?>images/logo.png" alt="<?php echo $blogname; ?>" class="hide">
          <span class="hidden-nav-xs m-l-sm">Musik</span>
        </a>
        <a class="btn btn-link visible-xs" data-toggle="dropdown" data-target=".user">
          <i class="icon-settings"></i>
        </a>
      </div>      <ul class="nav navbar-nav hidden-xs">
        <li>
          <a href="#nav,.navbar-header" data-toggle="class:nav-xs,nav-xs" class="text-muted">
            <i class="fa fa-indent text"></i>
            <i class="fa fa-dedent text-active"></i>
          </a>
        </li>
      </ul>
      <form class="navbar-form navbar-left input-s-lg m-t m-l-n-xs hidden-xs" name="keyform" method="get" action="<?php echo BLOG_URL; ?>index.php" role="search">
        <div class="form-group">
          <div class="input-group">
            <span class="input-group-btn">
              <button type="submit" class="btn btn-sm bg-white btn-icon rounded"><i class="fa fa-search"></i></button>
            </span>
            <input name="keyword" type="text" class="form-control input-sm no-border rounded" placeholder="Search songs, albums...">
          </div>
        </div>
      </form>
      <div class="navbar-right ">
        <ul class="nav navbar-nav m-n hidden-xs nav-user user">
		<?php if (ROLE == ROLE_ADMIN):?>
		<?php
		$hidecmnum = ROLE == ROLE_ADMIN ? $sta_cache['hidecomnum'] : $sta_cache[UID]['hidecommentnum'];
		if ($hidecmnum > 0):
		$n = $hidecmnum > 999 ? '...' : $hidecmnum;
		?>
          <li class="hidden-xs">
            <a href="#" class="dropdown-toggle lt" data-toggle="dropdown">
              <i class="icon-bell"></i>
              <span class="badge badge-sm up bg-danger count"><?php echo $hidecmnum; ?></span>
            </a>
            <section class="dropdown-menu aside-xl animated fadeInUp">
              <section class="panel bg-white">
                <div class="panel-heading b-light bg-light">
                  <strong>You have <span class="count"><?php echo $hidecmnum; ?></span> notifications</strong>
                </div>
                <div class="list-group list-group-alt">
<?php
	if($comment):
	foreach($comment as $key=>$value):
	$ishide = $value['hide']=='y'?'<font color="red">[待审]</font>':'';
	$mail = !empty($value['mail']) ? "({$value['mail']})" : '';
	$ip = !empty($value['ip']) ? "<br />来自：{$value['ip']}" : '';
	$poster = !empty($value['url']) ? '<a href="'.$value['url'].'" target="_blank">'. $value['poster'].'</a>' : $value['poster'];
	$value['content'] = str_replace('<br>',' ',$value['content']);
	$sub_content = subString($value['content'], 0, 50);
	$value['title'] = subString($value['title'], 0, 42);
	;?>

                  <a href="#" class="media list-group-item">
                    <span class="pull-left thumb-sm">
                      <img src="<?php echo getGravatar($mail); ?>" alt="<?php echo $poster ;?>" class="img-circle">
                    </span>
                    <span class="media-body block m-b-none">
                      <?php echo $value['title'] ;?><br>
                      <small class="text-muted">
                       <?php echo $value['date']; ?>
                     </small>
                    </span>
                  </a>
	<?php endforeach; ?>
	<?php endif; ?>
                </div>
                <div class="panel-footer text-sm">
                  <a href="<?php echo BLOG_URL; ?>admin/comment.php?hide=y" class="pull-right"><i class="fa fa-cog"></i></a>
                  <a href="#notes" data-toggle="class:show animated fadeInRight">See all the notifications</a>
                </div>
              </section>
            </section>
          </li>
		  <?php endif; ?>
          <?php endif; ?>
          <li class="dropdown">
		  <?php global $CACHE;
	             $user_cache = $CACHE->readCache('user');
	             $name = $user_cache[1]['mail'] != '' ? "<a href=\"mailto:".$user_cache[1]['mail']."\">".$user_cache[1]['name']."</a>" : $user_cache[1]['name'];?>
            <a href="#" class="dropdown-toggle bg clear" data-toggle="dropdown">
              <span class="thumb-sm avatar pull-right m-t-n-sm m-b-n-sm m-l-sm">
			  <?php if (!empty($user_cache[1]['photo']['src'])): ?>
                <img src="<?php echo BLOG_URL.$user_cache[1]['photo']['src']; ?>" width="<?php echo $user_cache[1]['photo']['width']; ?>" height="<?php echo $user_cache[1]['photo']['height']; ?>" alt="<?php echo $user_cache[1]['name']; ?>">
              <?php endif;?>
              </span>
              <?php echo $user_cache[1]['name']; ?> <b class="caret"></b>
            </a>

            <ul class="dropdown-menu animated fadeInRight">  
			<?php if($ckname != ''): ?>
			<li>
                <span class="arrow top"></span>
			<a>嘿! <?php echo $ckname; ?>, 欢迎回来!</a>
			</li>
			<?php endif;?>
			<?php if (ROLE == ROLE_ADMIN):?>
              <li>
                <span class="arrow top"></span>
                <a href="<?php echo BLOG_URL; ?>admin/">Settings</a>
              </li>
			  <?php global $CACHE; 
	              $istwitter = Option::get('istwitter');
	              if ($istwitter == 'y') : ?>
              <li>
                <a href="<?php echo BLOG_URL . 'admin/twitter.php' ?>">Twitter</a>
              </li>
			  <?php endif;?>
		<?php
		$hidecmnum = ROLE == ROLE_ADMIN ? $sta_cache['hidecomnum'] : $sta_cache[UID]['hidecommentnum'];
		if ($hidecmnum > 0):
		$n = $hidecmnum > 999 ? '...' : $hidecmnum;
		?>
              <li>
                <a href="<?php echo BLOG_URL; ?>admin/comment.php?hide=y">
                  <span class="badge bg-danger pull-right"><?php echo $hidecmnum; ?></span>
                  Notifications
                </a>
              </li>
		<?php endif; ?>
              <li class="divider"></li>
              <li>
                <a href="<?php echo BLOG_URL; ?>admin/?action=logout" data-toggle="" >Logout</a>
              </li>
		<?php else:?>
		      <li>
                <a href="<?php echo BLOG_URL; ?>signin.html" data-toggle="" >Sign in</a>
              </li>
        <?php endif;?>
            </ul>
          </li>
        </ul>
      </div>      
    </header>
    <section>
      <section class="hbox stretch">
        <!-- .aside -->
        <aside class="bg-black dk nav-xs aside hidden-print" id="nav">          
          <section class="vbox">
            <section class="w-f-md scrollable">
              <div class="slim-scroll" data-height="auto" data-disable-fade-out="true" data-distance="0" data-size="10px" data-railOpacity="0.2">
                


                <!-- nav -->                 
                <nav class="nav-primary hidden-xs">
                  <ul class="nav bg clearfix">
                    <li class="hidden-nav-xs padder m-t m-b-sm text-xs text-muted">
                      Ting
                    </li>
                    <li>
                      <a href="<?php echo BLOG_URL; ?>" data-target="#content" data-el="#bjax-el" data-replace="true">
                        <i class="icon-disc icon text-success"></i>
                        <span class="font-bold">What's new</span>
                      </a>
                    </li>
                    <li>
                      <a href="<?php echo Url::sort(''._g('Xiami_SortUrl').''); ?>" data-target="#content" data-el="#bjax-el" data-replace="true">
                        <i class="icon-music-tone-alt icon text-info"></i>
                        <span class="font-bold">Musik</span>
                      </a>
                    </li>
                    <li>
                      <a href="<?php echo Url::sort(''._g('Youku_SortUrl').''); ?>" data-target="#content" data-el="#bjax-el" data-replace="true">
                        <i class="icon-social-youtube icon  text-primary"></i>
                        <span class="font-bold">Video</span>
                      </a>
                    </li>
                    <li>
                      <a href="<?php echo BLOG_URL; ?>MusikBox.html" data-bjax="<?php echo BLOG_URL; ?>MusikBox.html">
					    <i class="icon-playlist icon text-success-lter"></i>
                        <span class="font-bold">Musik Box</span>
                      </a>
                    </li>
					<?php global $CACHE; 
					$istwitter = Option::get('istwitter'); 
					if ($istwitter == 'y') : ?>
                    <li>
                      <a href="<?php echo BLOG_URL; ?>t/" data-target="#content" data-el="#bjax-el" data-replace="true">
                        <i class="icon-list icon  text-info-dker"></i>
                        <span class="font-bold">Twitter</span>
                      </a>
                    </li>
					<?php endif;?>
					<li>
                      <a href="<?php echo BLOG_URL; ?>guest.html" data-target="#content" data-el="#bjax-el" data-replace="true">
					    <i class="icon-users icon text-primary"></i>
                        <span class="font-bold">Guest</span>
                      </a>
                    </li>
                    <li class="m-b hidden-nav-xs"></li>
                  </ul>
                  <ul class="nav" data-ride="collapse">
                    <li class="hidden-nav-xs padder m-t m-b-sm text-xs text-muted">
                      <!-- 预留位置 -->
                    </li>

	              </ul>
                </nav>
                <!-- / nav -->
              </div>
            </section>
            
            <footer class="footer hidden-xs no-padder text-center-nav-xs">
              <div class="bg hidden-xs ">
                  <div class="dropdown dropup wrapper-sm clearfix">
		    <?php global $CACHE;
	             $user_cache = $CACHE->readCache('user');
	             $name = $user_cache[1]['mail'] != '' ? "<a href=\"mailto:".$user_cache[1]['mail']."\">".$user_cache[1]['name']."</a>" : $user_cache[1]['name'];?>
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                      <span class="thumb-sm avatar pull-left m-l-xs">
					  
                        <img src="<?php echo TEMPLATE_URL; ?>images/ting.png" alt="<?php echo $blogname; ?>">
                        <i class="on b-black"></i>
					  
                      </span>
                      <span class="hidden-nav-xs clear">
                        <span class="block m-l">
                          <strong class="font-bold text-lt"><?php echo $user_cache[1]['name']; ?></strong> 
                          <b class="caret"></b>
                        </span>
                        <span class="text-muted text-xs block m-l"></span>
                      </span>
                    </a>
                    <ul class="dropdown-menu animated fadeInRight aside text-left">   
					<?php if (ROLE == ROLE_ADMIN):?>
                      <li>
                        <span class="arrow bottom hidden-nav-xs"></span>
                        <a href="<?php echo BLOG_URL; ?>admin/">Settings</a>
                      </li>
			  <?php global $CACHE; 
	              $istwitter = Option::get('istwitter');
	              if ($istwitter == 'y') : ?>
              <li>
                <a href="<?php echo BLOG_URL . 'admin/twitter.php' ?>">Twitter</a>
              </li>
			  <?php endif;?>
					  <?php
		$hidecmnum = ROLE == ROLE_ADMIN ? $sta_cache['hidecomnum'] : $sta_cache[UID]['hidecommentnum'];
		if ($hidecmnum > 0):
		$n = $hidecmnum > 999 ? '...' : $hidecmnum;
		?>
                      <li>
                        <a href="<?php echo BLOG_URL; ?>admin/comment.php?hide=y">
                          <span class="badge bg-danger pull-right"><?php echo $hidecmnum; ?></span>
                          Notifications
                        </a>
                      </li>
					 <?php endif; ?>
                      <li>
                     <a href="<?php echo BLOG_URL; ?>admin/?action=logout" >Logout</a>
                      </li>
		             <?php else:?>
		              <li>
                     <a href="<?php echo BLOG_URL; ?>signin.html" >Sign in</a>
                      </li>
                     <?php endif;?>
					 <li>
					 <a><?php echo $footer_info; ?></a>
					 </li>
                    </ul>
                  </div>
                </div>            </footer>
          </section>
        </aside>
        <!-- /.aside -->